package com.tuanzi.loan.web.lazy.channel;

import com.tuanzi.loan.business.service.common.CommProductChannelService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.channel.ChannelSearchRequest;
import com.tuanzi.loan.vo.response.channel.ChannelSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class ChannelLazyDataModel extends LazyDataSessionModel<ChannelSearchRequest, ChannelSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private CommProductChannelService commProductChannelService;

	public ChannelLazyDataModel(ChannelSearchRequest searchRequest, CurrentUserBean session, CommProductChannelService commProductChannelService) {
		super(searchRequest, session);
		this.commProductChannelService = commProductChannelService;
	}

	@Override
	protected Page<ChannelSearchResponse> doLoad0(PageSearcher<ChannelSearchRequest> pageSearcher) {
		return commProductChannelService.list(pageSearcher);
	}
}
